﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.ServiceModel;
using WcfAfvandingServiceLibrary;

namespace AfvandingSystem
{
    /// <summary>
    /// Interaction logic for OpretPumpstation.xaml
    /// </summary>
    public partial class OpretPumpstation : Window
    {
        IAfvandingL afvanding;

        public OpretPumpstation(IAfvandingL afvanding)
        {
            InitializeComponent();
            this.afvanding = afvanding;
        }

        private void btnOpret_Click(object sender, RoutedEventArgs e)
        {
            string netværksadresse = txtnetværksadresse.Text;
            string ipadresse = txtipadresse.Text;
            int portnummer = int.Parse(txtportnummer.Text);
            string vandstand = txtvandstand.Text;

            afvanding.OpretPumpestation(netværksadresse, ipadresse, portnummer, vandstand);
            MessageBox.Show("Pumpestationen er oprettet");
        }
    }
}
